package net.xiangcaowuyu.mybatsmultidatasource.controller;

import net.xiangcaowuyu.mybatsmultidatasource.domain.Test;
import net.xiangcaowuyu.mybatsmultidatasource.domain.User;
import net.xiangcaowuyu.mybatsmultidatasource.service.ITestService;
import net.xiangcaowuyu.mybatsmultidatasource.service.IUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class UserController {

    @Resource
    private ITestService testService;

    @Resource
    private IUserService userService;

    @GetMapping("/master")
    public List<Test> getMasterAll(){
        return testService.selectAll();
    }

    @GetMapping("/cluster")
    public List<User> getClusterAll(){
        return userService.selectAll();
    }

}
